package com.weixing.mall.provider.model.vo.report.storage;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.weixing.mall.base.constant.GlobalConstant;
import com.weixing.mall.provider.api.model.enums.OrderTypeEnum;
import com.weixing.mall.provider.model.enums.OrderFromEnum;
import com.weixing.mall.provider.support.excel.EnumConverter.OrderFromConverter;
import com.weixing.mall.provider.support.excel.EnumConverter.OrderTypeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;

/**
 * @author jzy
 * @date 2020/6/6
 */
@Data
@Accessors(chain = true)
@ApiModel(value="StorageRegularReturnVo", description="06仓储部-正价退货报表")
@ContentRowHeight(40)
public class StorageRegularReturnVo {
    @ApiModelProperty(value = "款号")
    @ExcelIgnore
    private String styleNo;
    @ApiModelProperty(value = "sku")
    @ExcelIgnore
    private String skuDesp;




    @ApiModelProperty(value = "商品图片")
    @ExcelIgnore
    private String goodsImg;
    @ExcelProperty("商品图片")
    @ColumnWidth(10)
    private URL goodsImgUrl;
    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
        try {
            if (StrUtil.isNotEmpty(goodsImg)){
                this.goodsImgUrl=new URL(GlobalConstant.IMG_PATH_URL+goodsImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
    @ApiModelProperty(value = "订单号")
    @ExcelProperty("订单号")
    private String orderSn;
    @ApiModelProperty(value = "支付流水号")
    @ExcelProperty("支付流水号")
    private String outTradeNo;
    @ApiModelProperty(value = "分类 (比如时尚专区、专柜、饰品)")
    @ExcelProperty("分类")
    private String catName;
    @ApiModelProperty(value = "系列")
    @ExcelProperty("系列")
    private String  goodsSys;
    @ApiModelProperty(value = "订单类型")
    @ExcelProperty(value = "订单类型",converter = OrderTypeConverter.class)
    private OrderTypeEnum orderType;
    @ApiModelProperty(value = "活动名称")
    @ExcelProperty("活动名称")
    private String actName;
    @ApiModelProperty(value = "商品货号")
    @ExcelProperty("商品货号")
    private String goodsSn;
    @ApiModelProperty(value = "商品名称")
    @ExcelProperty("商品名称")
    private String goodsName;
    @ApiModelProperty(value = "零售价")
    @ExcelProperty("零售价")
    private BigDecimal goodsPrice;
    @ApiModelProperty(value = "订单金额")
    @ExcelProperty("订单金额")
    private BigDecimal price;
    @ApiModelProperty(value = "优惠价")
    @ExcelProperty("优惠价")
    private BigDecimal discountPrice;
    @ApiModelProperty(value = "市场价/吊牌价")
    @ExcelProperty("市场价/吊牌价")
    private BigDecimal marketPrice;
    @ApiModelProperty(value = "折扣")
    @ExcelProperty("折扣")
    private BigDecimal discount;
    @ApiModelProperty(value = "颜色")
    @ExcelProperty("颜色")
    private String color;
    @ApiModelProperty(value = "尺码")
    @ExcelProperty("尺码")
    private String size;
    @ApiModelProperty(value = "数量")
    @ExcelProperty("数量")
    private String quantity;
    @ApiModelProperty(value = "下单人")
    @ExcelProperty("下单人")
    private String buyer;
    @ApiModelProperty(value = "下单代理")
    @ExcelProperty("下单代理")
    private String agentName;
    @ApiModelProperty(value = "客户姓名")
    @ExcelProperty("客户姓名")
    private String contactUser;
    @ApiModelProperty(value = "客户手机")
    @ExcelProperty("客户手机")
    private String contactPhone;
    @ApiModelProperty(value = "客户地址")
    @ExcelProperty("客户地址")
    private String address;
    @ApiModelProperty(value = "客户身高")
    @ExcelProperty("客户身高")
    private Integer height;
    @ApiModelProperty(value = "客户体重")
    @ExcelProperty("客户体重")
    private BigDecimal weight;
    @ApiModelProperty(value = "快递公司")
    @ExcelProperty("快递公司")
    private String expressName;
    @ApiModelProperty(value = "快递单号")
    @ExcelProperty("快递单号")
    private String expressSn;
    @ApiModelProperty(value = "订单来源")
    @ExcelProperty(value = "订单来源",converter = OrderFromConverter.class)
    private OrderFromEnum orderFrom;
    @ApiModelProperty(value = "客服")
    @ExcelProperty("客服")
    private String customerName;
    @ApiModelProperty(value = "审核时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("审核时间")
    private Date auditTime;
    @ApiModelProperty(value = "经销商")
    @ExcelProperty("经销商")
    private String distributorName;
    @ApiModelProperty(value = "质检时间")
    @ExcelProperty("质检时间")
    private String checkTime;
    @ApiModelProperty(value = "发货员名称")
    @ExcelProperty("发货员名称")
    private String shipperName;
    @ApiModelProperty(value = "发货时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("发货时间")
    private Date shipTime;
    @ApiModelProperty(value = "接收时间")
    @ExcelProperty("接收时间")
    private String receiveTime;
    @ApiModelProperty(value = "仓库名称")
    @ExcelProperty("仓库名称")
    private String depotName;
    @ApiModelProperty(value = "库位")
    @ExcelProperty("库位")
    private String storehouse;
    @ApiModelProperty(value = "备注")
    @ExcelProperty("客户备注")
    private String remark;

    @ApiModelProperty(value = "仓库ID")
    @ExcelIgnore
    private Long depotId;

    @ApiModelProperty(value = "货品ID")
    @ExcelIgnore
    private Long productId;

    @ApiModelProperty(value = "库存编号")
    @ExcelProperty("库存编号")
    private String depotSn;

    @ApiModelProperty(value = "接收序号")
    @ExcelProperty("接收序号")
    private String depotOrder;

    @ApiModelProperty(value = "接收备注")
    @ExcelProperty("接收备注")
    private String receiveRemark;

}
